package com.qezhhnjy.demo.security.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author zhaoyangfu
 * @date 2021/6/25-17:42
 */
@RestControllerAdvice
@Slf4j
public class MyExceptionHandler {

    @ExceptionHandler(Exception.class)
    public String runtimeExceptionHandler(Exception e) {
        log.error(e.getMessage(), e);
        return e.getMessage();
    }
}
